package com.example.lib;

import java.io.File;

import android.os.Environment;
import android.util.Log;

public class EpubUTIL {
	public static String ROOT_LOCATION = Environment
			.getExternalStorageDirectory() + "/Epub_Decompress";
	public static String ROOT_CATCHEPUB = Environment
			.getExternalStorageDirectory().getAbsoluteFile()
			+ "/the-file-name.txt";
	public static String UNZIP_ROOT = "";
	public static String UNZIP_container = "";
	public static String UNZIP_package = "";

	public static void createRoot(String RootDir) {
		Log.v("ROOT", RootDir);
		String now = "";
		String pre = "";
		String[] dirs = RootDir.split("/");
		for (int i = 0; i < dirs.length - 1; i++) {
			if (!dirs[i].equals(""))
				pre = pre + "/" + dirs[i];

		}

		File fpre = new File(pre);
		if (!fpre.exists()) {
			createRoot(pre);
		}

		for (String string : dirs) {
			if (!string.equals(""))
				now = now + "/" + string;
		}

		File fmd = new File(now);
		if (!fmd.exists()) {

			fmd.mkdirs();
		} else {
			Log.v("Root exists !! ", now);

		}
		return;

	}

}
